<div id="app">
  <div class="p2">
    <a href="javascript:history.go(-1)" class="weui-btn weui-btn_mini weui-btn_default"> 返回 </a>
  </div>

  <div>
    <div class="weui-cells__title">充值记录</div>
    <div class="weui-cells">
      <div class="weui-cell" v-for="charge in charges">
        <div class="weui-cell__hd pr1 gray">{{charge.createTime}}</div>
        <div class="weui-cell__bd">{{charge.room?charge.room.topic+'群续费': '红包充值'}}</div>

        <div class="weui-cell__ft">
          <div class="red">{{charge.total_fee/100}}元</div>
        </div>
      </div>
    </div>
  </div>
  <div v-if="charges.length==0" class="gray my2 center">
    <img src="/img/empty.png" style="width: 150px" />
    <div class="font-12 bold">没有更多数据了</div>
  </div>

  <!-- <div class="p2 font-12 gray center">到底了~</div> -->
</div>

<script>
  new Vue({
    el: "#app",
    data: {
      charges: [],
    },
    created: function () {
      this.refresh();
    },
    methods: {
      refresh: function () {
        let that = this;
        axios.get("/client/getCharges").then((res) => {
          let { charges } = res.data;
          console.log(charges);
          that.charges = charges;
        });
      },
    },
  });
</script>
